#define   _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int a;
	scanf("%d", &a);
	int sum=a;
	for (int i = 0; i < 4; i++)
	{
		a = a * 10 + a;
		sum += a;
	}
	printf("%d",sum);
}